import Mock from 'mockjs'

const user = Mock.mock({
  userInfo: {
    name: '@cname()',
    id: '@integer(1, 100)',
  },
  token: '123456',
})

Mock.mock('/user/login', 'get', (req) => {
  if (req.body.username === '123' && req.body.password === '123456') {
    return { status: 200, message: '登录成功', data: user }
  }
})
